From: Florian Müllner Date: Mon, 18 May 2020 12:24:16 +0000 (+0200) Subject: extensions-app: Reset switch handle when it becomes insensitive X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~684^2^2~368 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=d2583aa47bd716f196bd1d171d9d134e2bed5d80;p=gnome-shell.git extensions-app: Reset switch handle when it becomes insensitive Currently the switches handle position reflects the requested extension state (as in: the user (de)activated the switch), while the actual extension state is reflected by the underlying state. That doesn't work well when the switch is insensitive though (for example on error), because the desaturation neuters the color that reflects the state. Address this by resetting the switch handle to the state when making it insensitive. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1263 --- diff --git a/subprojects/extensions-app/data/ui/extension-row.ui b/subprojects/extensions-app/data/ui/extension-row.ui index f54ab3c76..4753cbc23 100644 --- a/subprojects/extensions-app/data/ui/extension-row.ui +++ b/subprojects/extensions-app/data/ui/extension-row.ui @@ -54,7 +54,7 @@ - + True True center diff --git a/subprojects/extensions-app/js/main.js b/subprojects/extensions-app/js/main.js index 005d1ddc6..264e684e8 100644 --- a/subprojects/extensions-app/js/main.js +++ b/subprojects/extensions-app/js/main.js @@ -332,6 +332,7 @@ var ExtensionRow = GObject.registerClass({ 'versionLabel', 'authorLabel', 'updatesIcon', + 'switch', 'revealButton', 'revealer', ], @@ -451,6 +452,9 @@ var ExtensionRow = GObject.registerClass({ action.set_state(new GLib.Variant('b', state)); action.enabled = this._canToggle(); + if (!action.enabled) + this._switch.active = state; + this._updatesIcon.visible = this.hasUpdate; this._versionLabel.label = this.version.toString();